package com.fortune.service.impl;

import com.fortune.dao.WechatProductDao;
import com.fortune.dto.in.cOrder.VendorId;
import com.fortune.service.WechatProductSevice;
import com.fortune.vo.wechatProduct.ManufacturerProductList;
import com.fortune.vo.wechatProduct.Product;
import com.fortune.vo.wechatProduct.TerminalDiscount;
import com.fortune.vo.wechatProduct.VendorListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.List;

@Service
public class WechatProductSeviceImpl implements WechatProductSevice {
    @Autowired
    private WechatProductDao wechatProductDao;

    /**
     * 厂商列表
     * @param did
     * @return
     */
    @Override
    public List<VendorListVo> findVendorListVoList(String did) {
        return wechatProductDao.findVendorListVoList(did);
    }

    /**
     * 查询是否当前经销商有自营的商品
     * @param did
     * @return
     */
    @Override
    public Integer findSelfSupport(String did) {
        return wechatProductDao.findSelfSupport(did);
    }

    /**
     * 选择厂商查询商品列表
     * @param vendorId
     * @return
     */
    @Override
    public List<ManufacturerProductList> findManufacturerProductList(String vendorId) {
        return wechatProductDao.findManufacturerProductList(vendorId);
    }

    @Override
    public List<ManufacturerProductList> findZYProductList(String did) {
        return wechatProductDao.findZYProductList(did);
    }

    /**
     * 查询优惠政策
     * @param vendorId
     * @param mpid
     * @return
     */
    @Override
    public TerminalDiscount findTerminalDiscount(String vendorId, String mpid) {
        return wechatProductDao.findTerminalDiscount(vendorId, mpid);
    }

    /**
     * 查询商品列表
     * @param mid
     * @return
     */
    @Override
    public List<Product> findListProducts(String mid) {
        List<Product> findListProducts = wechatProductDao.findListProducts(mid);
        return findListProducts;
    }

    /**
     * 查询当前经销商所对应的所有厂商
     * @param did
     * @return
     */
    @Override
    public List<VendorId> findVendorIdList(String did) {
        return wechatProductDao.findVendorIdList(did);
    }

    @Override
    public BigDecimal priceByCProduct(String did, String clientId, String mid, String mpid) {
        return wechatProductDao.priceByCProduct(did, clientId, mid, mpid);
    }

    @Override
    public BigDecimal priceByDProduct(String did, String mid, String mpid) {
        return wechatProductDao.priceByDProduct(did, mid, mpid);
    }

    @Override
    public BigDecimal priceByZYProduct(String did, String mpid) {
        return wechatProductDao.priceByZYProduct(did, mpid);
    }

    @Override
    public BigDecimal clientPrice(String did, String cid, String mid, String mpid) {
        return wechatProductDao.clientPrice(did, cid, mid, mpid);
    }
}
